package com.baiyun.lease.common.exception;

import com.baiyun.lease.common.result.ResultCodeEnum;
import lombok.Data;

/**
 * Created with IntelliJ IDEA.
 *
 * @Author: 许瑞淇
 * @Date: 2024/06/14/22:11
 * @Description:
 */
@Data
public class LeaseException extends RuntimeException{
    //异常验证码
    private Integer code;

    public LeaseException(String message,Integer code){
        super(message);
        this.code = code;
    }

    public LeaseException(ResultCodeEnum resultCodeEnum){
        super(resultCodeEnum.getMessage());
        this.code = resultCodeEnum.getCode();
    }
}
